package com.cloud.force.api.handler.common;

import org.springframework.context.ApplicationContext;
import org.springframework.jdbc.core.JdbcTemplate;

import com.cloud.force.api.handler.Request;
import com.cloud.force.api.handler.Response;
import com.cloud.force.api.handler.SurroundHandler;
import com.cloud.force.api.mapper.TabPartMapper;

public class TestJdbcTemplate2Handler extends SurroundHandler{
	
	@Override
	public void afterHandler(Request request, Response resp, ApplicationContext context) {
		TabPartMapper mapper = context.getBean(TabPartMapper.class);
		mapper.selectAll();
	}

	@Override
	public void beforeHandler(Request request, Response resp, ApplicationContext context) {
		JdbcTemplate jdbcTemplate = context.getBean(JdbcTemplate.class);
		jdbcTemplate.execute("insert into tab_part values (1, 2);");
		
	}

}
